<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Magic ERP : Gestion commercial</title>
	<link type="image/x-icon" href="images/logoMini.ico" rel="shortcut icon">
	<link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css" />
    <link rel="stylesheet" type="text/css" href="css/desktop.css" />
    <!-- Row Editor plugin css -->
	<link rel="stylesheet" type="text/css" href="extjs/examples/ux/css/rowEditorCustom.css" />
	<link rel="stylesheet" type="text/css" href="extjs/examples/ux/css/RowEditor.css" />
    
	<!-- App custom css -->
	<link rel="stylesheet" type="text/css" href="css/crudgrid.css" />
	<!-- GC -->
 	<!-- LIBS -->
 	<script type="text/javascript" src="extjs/adapter/ext/ext-base.js"></script>
 	<!-- ENDLIBS -->
	<script type="text/javascript" src="extjs/ext-all-debug.js"></script>
	
	<!-- Row Editor plugin js -->
	<script src="extjs/examples/ux/RowEditor.js"></script>
	<!-- DESKTOP -->
    <script type="text/javascript" src="js/config/lang/fr.js"></script>
    <script type="text/javascript" src="js/StartMenu.js"></script>
    <script type="text/javascript" src="js/TaskBar.js"></script>
    <script type="text/javascript" src="js/Desktop.js"></script>
    <script type="text/javascript" src="js/App.js"></script>
    <script type="text/javascript" src="js/Module.js"></script>
    
    <script type="text/javascript" src="js/config/config.js"></script>
    <script type="text/javascript" src="js/config/composants.js"></script>
    <script type="text/javascript" src="js/config/param.js"></script>
    <script type="text/javascript" src="js/main.js"></script>
    
    <style type="text/css">
    .search-item {
	    font:normal 11px tahoma, arial, helvetica, sans-serif;
	    padding:3px 10px 3px 10px;
	    border:1px solid #fff;
	    border-bottom:1px solid #eeeeee;
	    white-space:normal;
	    color:#555;
	}
	.x-combo-list-item h3 {
	    display:block;
	    font:inherit;
	    font-weight:bold;
	    color:#222;
	    float: left;
	    width: 320px
	}
	
	.x-combo-list-item h3 span {
	    float: left;
	    font-weight:normal;
	    margin:0 0 5px 5px;
	    width:70px;
	    display:block;
	    clear:none;
	}
	.x-combo-list-item h4 {
	    float: left;
	    font-weight:normal;
	    margin:0 0 5px 5px;
	    width:50px;
	    display:block;
	    clear:none;
	}
    </style>
</head>
<body scroll="no">
<div id="blockDiv" style="position:absolute;width:100%;height:100%;top:0px; left:0; z-index:13000;background-color:white;display:block"></div>

<div id="x-desktop">
    <div id="infoBar" style="margin:5px; float:right;background: #efefef;
	   height: auto !important; 
	   height: 100%; 
	   min-height: 100%; "></div>
    <a style="margin:5px; float:right;"><img src="images/logoMini.png" /></a>
    <dl id="x-shortcuts">
        <dt id="grid-articles-shortcut">
            <a href="#"><img src="images/s.gif" />
            <div>Articles</div></a>
        </dt>
        <dt id="grid-client-shortcut">
            <a href="#"><img src="images/s.gif" />
            <div>Clients</div></a>
        </dt>
        <dt id="grid-fournisseur-shortcut">
            <a href="#"><img src="images/s.gif" />
            <div>Fournisseurs</div></a>
        </dt>
        <dt id="grid-docentetevente-shortcut">
            <a href="#"><img src="images/s.gif" />
            <div>Documents de vente</div></a>
        </dt>
        <dt id="grid-docenteteachat-shortcut">
            <a href="#"><img src="images/s.gif" />
            <div>Documents d'achat</div></a>
        </dt>
    </dl>
</div>
<div id="ux-taskbar">
	<div id="ux-taskbar-start"></div>
	<div id="ux-taskbuttons-panel"></div>
	<div class="x-clear"></div>
</div>
	<script type="text/javascript">
	var currentUser;
	//Controle de connexion
    Ext.Ajax.request({
    	url: 'utilisateurs/controle.action',
    	success: function( result, request) { 
    		var responseData = Ext.decode(result.responseText);
    		if(responseData.success==false)
        		document.location="index.jsp";
           	else
           	{
           		var tempStore = new Ext.data.JsonStore({fields:[
		            {name: 'idUtilisateur'},
			        {name: 'nom', type: 'string'}, 
			        {name: 'prenom', type: 'string'}, 
			        {name: 'email',type: 'string'}, 
			        {name: 'login',type: 'string'}, 
			        {name: 'idProfil',type: 'string'}],
		        root:'data'});
	        
		    	tempStore.loadData(responseData);
		        currentUser=tempStore.getAt(0).data;
		        var Mydiv =Ext.query('#blockDiv');
		   		Ext.each(Mydiv, function(obj_item){
		   			obj_item.style.display="none";
				});
		   		loadingStore=0;
		   		Ext.MessageBox.wait("Chargement...", 'Chargement des modules');
				chargerStoresParDefaut();
           	}      	
       	},
       	failure : function(){
           	//document.location="index.jsp";
        }
    });
    </script>
</body>
</html>
